package file;

import java.io.File;

public class FileDemo {
    public static void main(String[] args) {
        File file=new File("./demo.txt");

        String name=file.getName();
        System.out.println(name);

        long length=file.length();
        System.out.println(length+"字节");
        boolean cr=file.canRead();
        System.out.println("是否可读"+cr);
        boolean cw=file.canWrite();
        System.out.println("是否可写"+cw);
        boolean ih=file.isHidden();
        System.out.println("是否隐藏"+ih);
        file.getName();
        System.out.println("是否是文件"+file.isFile());

    }
}